package com.ruoyi.dl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlOrderDeductionMapper;
import com.ruoyi.dl.domain.DlOrderDeduction;
import com.ruoyi.dl.service.IDlOrderDeductionService;
import com.ruoyi.common.core.text.Convert;

/**
 * 扣款记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-14
 */
@Service
public class DlOrderDeductionServiceImpl implements IDlOrderDeductionService 
{
    @Autowired
    private DlOrderDeductionMapper dlOrderDeductionMapper;

    /**
     * 查询扣款记录
     * 
     * @param id 扣款记录ID
     * @return 扣款记录
     */
    @Override
    public DlOrderDeduction selectDlOrderDeductionById(Long id)
    {
        return dlOrderDeductionMapper.selectDlOrderDeductionById(id);
    }

    /**
     * 查询扣款记录列表
     * 
     * @param dlOrderDeduction 扣款记录
     * @return 扣款记录
     */
    @Override
    public List<DlOrderDeduction> selectDlOrderDeductionList(DlOrderDeduction dlOrderDeduction)
    {
        return dlOrderDeductionMapper.selectDlOrderDeductionList(dlOrderDeduction);
    }

    /**
     * 新增扣款记录
     * 
     * @param dlOrderDeduction 扣款记录
     * @return 结果
     */
    @Override
    public int insertDlOrderDeduction(DlOrderDeduction dlOrderDeduction)
    {
        dlOrderDeduction.setCreateTime(DateUtils.getNowDate());
        return dlOrderDeductionMapper.insertDlOrderDeduction(dlOrderDeduction);
    }

    /**
     * 修改扣款记录
     * 
     * @param dlOrderDeduction 扣款记录
     * @return 结果
     */
    @Override
    public int updateDlOrderDeduction(DlOrderDeduction dlOrderDeduction)
    {
        return dlOrderDeductionMapper.updateDlOrderDeduction(dlOrderDeduction);
    }

    /**
     * 删除扣款记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlOrderDeductionByIds(String ids)
    {
        return dlOrderDeductionMapper.deleteDlOrderDeductionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除扣款记录信息
     * 
     * @param id 扣款记录ID
     * @return 结果
     */
    @Override
    public int deleteDlOrderDeductionById(Long id)
    {
        return dlOrderDeductionMapper.deleteDlOrderDeductionById(id);
    }
}
